package com.xy.tianyu.utils

import com.bumptech.glide.load.resource.bitmap.CenterCrop
import com.bumptech.glide.load.resource.bitmap.CircleCrop
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
import com.bumptech.glide.request.RequestOptions
import com.xy.tianyu.R

/**
 * @time 2020/9/22 17:14
 * @class 描述:
 */
object GlideUtils {
    fun getRequestOptions():RequestOptions{
        return RequestOptions().placeholder(R.drawable.placeholder)
            .fallback(R.drawable.placeholder)
            .error(R.drawable.placeholder)
    }

    fun getVideoRequestOptions():RequestOptions{
        return RequestOptions().placeholder(R.drawable.bg_video_placeholder)
            .fallback(R.drawable.bg_video_placeholder)
            .error(R.drawable.bg_video_placeholder)
    }

    fun getRoundRequestOptions():RequestOptions{
        return RequestOptions().placeholder(R.drawable.placeholder)
            .fallback(R.drawable.placeholder)
            .error(R.drawable.placeholder)
            .transform(CenterCrop(),RoundedCorners(20))
    }

    fun getRound10RequestOptions():RequestOptions{
        return RequestOptions().placeholder(R.drawable.placeholder)
            .fallback(R.drawable.placeholder)
            .error(R.drawable.placeholder)
            .transform(CenterCrop(),RoundedCorners(10))
    }
}